package wanyi.test;

public class StringToInt {

	public void stringToInt (String string)
	{
//		char c = string.charAt(0);
//		char c1 = '1';
//		int n1 = 1;
		int result = 0;
		char[] array = string.toCharArray();
		int num = 0;
		for (char c : array)
		{
			result = result * 10;
			num = c - 48;
			result += num;
			
		}
		System.out.print(result);
//		System.out.println(c1);
//		System.out.println(n1);
	}
	
	public static void main (String[] args)
	{
		StringToInt test = new StringToInt();
		test.stringToInt("123");
	}
}
